package us.icitap.commandcenter.utils;

import com.vaadin.server.Page;
import com.vaadin.shared.Position;
import com.vaadin.ui.Notification;
import com.vaadin.ui.Notification.Type;

public class HandleNotification {

	public static void showErrorOnScreen(String errorMessage){
		Notification n = new Notification(errorMessage, Type.ERROR_MESSAGE);
		
		n.show(Page.getCurrent());
	}
	
	public static void showWarningOnScreen(String warningMessage){
		Notification n = new Notification(warningMessage, Type.WARNING_MESSAGE);
	
		n.show(Page.getCurrent());
	}
	
	public static void showInfoOnScreen(String infoMessage){
		Notification n = new Notification(infoMessage, Type.HUMANIZED_MESSAGE);
		n.setDelayMsec(3000);
		n.show(Page.getCurrent());
	}
	
	public static void showInfoOnTray(String infoMessage){
		Notification n = new Notification(infoMessage, Type.TRAY_NOTIFICATION);
		n.setPosition(Position.TOP_RIGHT);
		n.show(Page.getCurrent());
	}
	
	
}
